package com.example.mrzhou.lvmm.presenter.surround;

import com.example.mrzhou.lvmm.entity.surround.holiday.Holiday;
import com.example.mrzhou.lvmm.model.ModelFactory;
import com.example.mrzhou.lvmm.view.impl.surround.HolidayView;

import java.util.Map;

import rx.Subscriber;

/**
 * Created by Mr.zhou on 2016/10/27.
 */

public class HolidayPrensenter {

    private HolidayView holidayView;

    public HolidayPrensenter(HolidayView holidayView) {
        this.holidayView = holidayView;
    }

    public void getHolidayData(Map<String,String> map){
        ModelFactory.getISurModel().getHolidayData(map, new Subscriber<Holiday>() {
            @Override
            public void onCompleted() {
                holidayView.onFinsh();
            }

            @Override
            public void onError(Throwable e) {
                holidayView.onFaiure(e);
            }

            @Override
            public void onNext(Holiday holiday) {
                holidayView.onSuccess(holiday);
            }
        });
    }
}
